package nina.yiyou.salary.output

import spock.lang.Specification

class ResultMapMakerTest extends Specification {

  List _inputList1
  List _inputList2

  void setup() {
    // NOOP
  }

  def "Make:"() {
    given:
    _inputList1 = ['基本', [
        'y001': ['姓名': '张三'],
        'y002': ['姓名': '李四'],
    ]]

    _inputList2 = ['考勤', [
        'y001': ['应出勤': 40],
        'y002': ['应出勤': 80],
    ]]

    when:
    def result = make()

    then:
    result == [
        'y001': ['基本.姓名': '张三', '考勤.应出勤': 40],
        'y002': ['基本.姓名': '李四', '考勤.应出勤': 80],
    ]
  }

  def make() {
    return new ResultMapMaker([_inputList1, _inputList2]).make()
  }
}
